//
//  BLLog.swift
//  yiplayer
//
//  Created by wkun on 2024/6/13.
//

import Foundation
import OSLog

func printLog(_ log: Any?) {
    let formatter = DateFormatter()
    formatter.dateFormat = "yyyy-MM-dd HH:mm:ss.SSS "
    let d = formatter.string(from: Date())
    print(d, terminator: "")
    if log == nil {
        print("nil")
    }
    else {
        if let msg = log as? String {
            // 记录一条消息
            os_log("yiplayer: %{public}@", msg)
        }
    }
}
